473,421 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

Limiting the number of options shown in a <select> drop down menu.

Please Help Me!!

I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp).

There are about 70 options, and when you click the dropdown button, it
shows about 25 (depending on screen resolution) and then the gives you
a scroll bar to get to the rest.

My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options. Ideally I'd like to limit it to showning 5 to 10 options.

Quick example of what I want to acheive is to click on your IE Address
Bar's drop down button. Mine shows 14 urls and I can scroll down to
the others.

Any ideas appreciated.. HTML, VBScript, Javascript... what ever works.
:)
Jul 20 '05 #1
3 23271
da************@hotmail.com (Darren) wrote in
news:89**************************@posting.google.c om:
I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp). My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options.


Have you looked at the size attribute?
http://www.w3.org/TR/html4/interact/...ef-size-SELECT

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics
Jul 20 '05 #2
Dave Patton <dp*****@remove-for-nospam.confluence.org> wrote in message news:<Xn******************************@24.71.223.1 59>...
da************@hotmail.com (Darren) wrote in
news:89**************************@posting.google.c om:
I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp).

My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options.


Have you looked at the size attribute?
http://www.w3.org/TR/html4/interact/...ef-size-SELECT


Hi Dave

I tried to use the size attribute as you suggested; if you don't
include it in the <select> tag its default size is 1. I've added it
like this...
<select name="staffmember" size="2"> and it increased the size number
of viewable options making a scroll box with 2 rows. It does allow you
to scroll through the options but removes the drop down list.

This is not quite what I'm after :(

I need to keep the number of viewable options to be 1 row. But when
you click the drop down button you then see 5 (or whatever number) out
of the 70 options. Then in the drop down list be able to scroll
through the rest.

I've looked every high and low and still the best example is the way
IE Address bar works.

Thanks, any and all other suggestions are greatly appreciated :)
Jul 20 '05 #3
da************@hotmail.com (Darren) wrote:
I tried to use the size attribute as you suggested; if you don't
include it in the <select> tag its default size is 1. I've added it
like this...
<select name="staffmember" size="2"> and it increased the size number
of viewable options making a scroll box with 2 rows. It does allow you
to scroll through the options but removes the drop down list.

This is not quite what I'm after :(

I need to keep the number of viewable options to be 1 row. But when
you click the drop down button you then see 5 (or whatever number) out
of the 70 options. Then in the drop down list be able to scroll
through the rest.


Not possible in HTML.

The number of items displayed in the dropdown is a feature of the
browser and/or operating system. It will vary from user to user and is
out of your control.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens...
7
by: Hal Vaughan | last post by:
I have a sample script from a book ("Beginning JavaScript" by Paul Wilton) that removes or adds a choice to a <SELECT> element. The <FORM> is form1 and the <SELECT> is theDay. The example uses...
3
by: gekoblu | last post by:
Hi!, I want to fix via javascript the combo width to a fix value. I'd like to implement a kind of ALT / TITLE function to show the entire option when the text is longer than the combo width......
3
by: Bilal | last post by:
Hi, I've been looking all over the net for a way to increase the size of a drop down menu without any success. Does anyone perhaps have a way to display 11-15 items on a menu without having...
6
by: Omar | last post by:
Hi, In a JSP I have the next: .... codigo = "<select name='" + nombre + "'>\n<option selected value='default'>Escoge</option><option value='todos'>Todos</option>"; if (miRS != null) while...
1
by: mcapacci | last post by:
I would like to force the flow of the scrolling of the options listed in a drop down menu, <select>, from top to bottom without allowing bottom up scroll to appear; furthermore I need also to...
1
by: thesti | last post by:
hello, i need to validate birthday using javascript. the validation is that for example user couldn't choose the date 29, 30 and 31 if she has chosen February as the month before and the year % 4...
1
by: vinpkl | last post by:
hi all i have two dynamic drop downs of dealer id and category id which work properly with window.location var dealerid; function getList(xyz) {...
2
by: Mihai Popescu | last post by:
Is there a way to select lets say max selected options from a <select> tag... for example I have a select with 150 options... but I want to select maximum 30... I've tried with js onclick and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.